package com.ashen.study.aop.chain;

public class HandlerClient {

    static class HandlerA extends Handler{
        @Override
        protected void handlerProcess() {
            System.out.println("Handler of A");
        }
    }

    static class HandlerB extends Handler{
        @Override
        protected void handlerProcess() {
            System.out.println("Handler of B");
        }
    }

    static class HandlerC extends Handler{
        @Override
        protected void handlerProcess() {
            System.out.println("Handler of C");
        }
    }


    public static void main(String[] args) {
        Handler handlerA = new HandlerA();
        Handler handlerB = new HandlerB();
        Handler handlerC = new HandlerC();

        handlerA.setHandler(handlerB);
        handlerB.setHandler(handlerC);

        handlerA.execute();

    }
}
